<template>
  <div class="dialog">
    <el-dialog
      title="未审核通过原因"
      :visible.sync="showDialog"
      width="35%"
      top="0"
      :close-on-click-modal="false"
      @close="cancel"
    >
      <el-form
        ref="ruleForm"
        label-position="left"
        :model="formData"
        class="el-form"
      >
        <el-form-item label="未通过原因：" class="w100p" prop="reason">
          <el-input
            v-model="formData.reason"
            clearable
            :rows="2"
            type="textarea"
            placeholder="请输入未通过原因"
            :disabled="true"
          />
        </el-form-item>
        <el-form-item label="审核日期 ：" class="w100p" prop="auditDate">
          <el-date-picker
            v-model="formData.auditDate"
            type="date"
            placeholder="选择日期"
            value-format="yyyy-MM-dd"
            clearable
            :disabled="true"
          />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button class="cancelbtn" @click="cancel()">取 消</el-button>
        <!-- <el-button type="primary" class="savebtn" @click="save('ruleForm')">保 存</el-button> -->
      </div>
    </el-dialog>
  </div>
</template>

<script>

export default {
  name: '',
  components: { },
  props: {
    // 弹框名称
    show: {
      type: Boolean,
      default: false
    },
    editObject: {
      type: [Object],
      default: () => {
        return {}
      }
    }
  },
  data() {
    return {
      formData: this.editObject,
      showDialog: this.show
    };
  },

  watch: {
    show(v) {
      this.showDialog = v;
      if (v) {
        this.formData = this.editObject
        this.$nextTick(() => {
        this.$refs['ruleForm']?.clearValidate();
      });
      }
    }
  },
  created() {
  },
  mounted() {
  },
  methods: {
    close() {
      this.formData = {};
              this.$nextTick(() => {
        this.$refs['ruleForm']?.clearValidate();
      });
      this.$emit("closeDialog");
    },
    cancel() {
      this.formData = {};
              this.$nextTick(() => {
        this.$refs['ruleForm']?.clearValidate();
      });
      this.$emit("cancelDialog");
    }
  }
};
</script>

<style lang="scss" scoped>
</style>
